<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2022/3/5
 * Time: 10:34
 */
namespace app\api\validate;

use think\Validate;
class Login extends Validate
{

    protected $rule = [
        'mobile'  => 'require|unique:User',
        'password' => 'require|confirm:repassword',
        'repassword' => 'require',
        'nickname' => 'require',
    ];

    /**
     * 提示消息
     */
    protected $message = [
        'mobile.require' => '手机号不能为空',
        'mobile.unique' => '手机号以存在',
        'password.require' => '密码不能为空',
        'password.confirm' => '两次密码不一样',
        'nickname.require' => '昵称不能为空',
    ];

    /**
     * 字段描述
     */
    protected $field = [
    ];

    /**
     * 验证场景
     */
    protected $scene = [
        'register'  =>  ['mobile','password','repassword','nickname'],
        'login'  =>  ['password'],
    ];
}